﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BUS;
using DAO;


namespace FDeal.WUC
{
    public partial class ThongTinChiTietDanhMuc : System.Web.UI.UserControl
    {

        string iddanhmuc;
        protected void Page_Load(object sender, EventArgs e)
        {
            iddanhmuc = Request.QueryString["iddanhmuc"];
            if (!IsPostBack)
            {
                LoadDSChiTiet1();
            }
        }

        private void LoadDSChiTiet1()
        {
            ChiTietDealBUS chiTietDealBUS = new ChiTietDealBUS();
            List<CHITIETDEAL> dsChiTietDeal = chiTietDealBUS.Lay4theodanhmuc(iddanhmuc);

            foreach (CHITIETDEAL ct in dsChiTietDeal)
            {
                if (ct.TIEUDE.Length > 20)
                    ct.TIEUDE = ct.TIEUDE.Substring(0, 17) + "...";
                if (ct.TOMTATDEAL.Length > 170)
                    ct.TOMTATDEAL = ct.TOMTATDEAL.Substring(0, 167) + "...";
            }

            dlChiTiet1.DataSource = dsChiTietDeal;
            dlChiTiet1.DataBind();
        }
    }
}